#INPUT = 
#LIBINPUT = 
INPUT = evdev
LIBINPUT = $(INPUT)/libCodePortsEVDEV.la

AUDIO = alsa
LIBAUDIO = $(AUDIO)/libCodePortsALSA.la

#VIDEO = svgalib
#LIBVIDEO = $(VIDEO)/libCodePortsSVGA.la
VIDEO = framebuffer
LIBVIDEO = $(VIDEO)/libCodePortsFrameBuffer.la

INPUT_SUBDIRS = evdev
AUDIO_SUBDIRS = alsa
VIDEO_SUBDIRS = svgalib framebuffer

SUBDIRS = $(INPUT_SUBDIRS) $(AUDIO_SUBDIRS) $(VIDEO_SUBDIRS)

lib_LTLIBRARIES = \
	libCodePorts.la \
	stars.la \
	starsback.la \
	plasma.la \
	fire.la

noinst_PROGRAMS = \
	test \
	demo \
	codeports \
	keyboard_capture \
	video_clear \
	video_capture \
	image \
	sprite

EXTRA_DIST = \
	video_clear.sh \
	video_capture.sh

libCodePorts_la_SOURCES = \
	demo.h \
	plugin.h \
	plugin.c \
	formats.h \
	formats.c \
	box.h \
	box.c \
	keyboard.h \
	speakers.h \
	microphone.h \
	screen.h \
	screen.c \
	swap.h \
	swap.c \
	globals.h \
	globals.c \
	types.h \
	codeports.h \
	codeports.c
libCodePorts_la_CPPFLAGS = \
	-Wall \
	$(CP_GENERIC_CFLAGS) 
libCodePorts_la_LIBADD = \
	$(LIBINPUT) \
	$(LIBAUDIO) \
	$(LIBVIDEO) \
	$(CP_GENERIC_LIBS)

stars_la_SOURCES = \
	stars.c
stars_la_CPPFLAGS = \
	-Wall \
	-I . \
	$(CP_GENERIC_CFLAGS) 
stars_la_LDFLAGS = \
	-module \
	-shared \
	-avoid-version
stars_la_LIBADD = \
	$(CP_GENERIC_LIBS) \
	libCodePorts.la

starsback_la_SOURCES = \
	starsback.c
starsback_la_CPPFLAGS = \
	-Wall \
	-I . \
	$(CP_GENERIC_CFLAGS) 
starsback_la_LDFLAGS = \
	-module \
	-shared \
	-avoid-version
starsback_la_LIBADD = \
	$(CP_GENERIC_LIBS) \
	libCodePorts.la

plasma_la_SOURCES = \
	plasma.c
plasma_la_CPPFLAGS = \
	-Wall \
	-I . \
	$(CP_GENERIC_CFLAGS) 
plasma_la_LDFLAGS = \
	-module \
	-shared \
	-avoid-version
plasma_la_LIBADD = \
	$(CP_GENERIC_LIBS) \
	libCodePorts.la

fire_la_SOURCES = \
	fire.c
fire_la_CPPFLAGS = \
	-Wall \
	-I . \
	$(CP_GENERIC_CFLAGS) 
fire_la_LDFLAGS = \
	-module \
	-shared \
	-avoid-version
fire_la_LIBADD = \
	$(CP_GENERIC_LIBS) \
	libCodePorts.la

test_SOURCES = \
	test.c
test_CPPFLAGS = \
	-Wall \
	-I . \
	$(CP_GENERIC_CFLAGS)
test_LDADD = \
	$(CP_GENERIC_LIBS) \
	libCodePorts.la

demo_SOURCES = \
	demo.c
demo_CPPFLAGS = \
	-Wall \
	-I . \
	$(CP_GENERIC_CFLAGS)
demo_LDADD = \
	$(CP_GENERIC_LIBS) \
	libCodePorts.la \
	-ldl \
	"-dlopen" stars.la \
	"-dlopen" starsback.la \
	"-dlopen" plasma.la \
	"-dlopen" fire.la
demo_DEPENDENCIES = \
	stars.la \
	starsback.la \
	plasma.la \
	fire.la

codeports_SOURCES = \
	codeports.h \
	codeports.c
codeports_CPPFLAGS = \
	-Wall \
	-DCP_MAIN \
	-I . \
	$(CP_GENERIC_CFLAGS)
codeports_LDADD = \
	$(CP_GENERIC_LIBS) \
	libCodePorts.la \
	-ldl \
	"-dlopen" stars.la \
	"-dlopen" starsback.la \
	"-dlopen" plasma.la \
	"-dlopen" fire.la
codeports_DEPENDENCIES = \
	stars.la \
	starsback.la \
	plasma.la \
	fire.la

keyboard_capture_SOURCES = \
	keyboard_capture.c
keyboard_capture_CPPFLAGS = \
	-Wall \
	-I . \
	$(CP_GENERIC_CFLAGS)
keyboard_capture_LDADD = \
	$(CP_GENERIC_LIBS) \
	libCodePorts.la

video_clear_SOURCES = \
	video_clear.c
video_clear_CPPFLAGS = \
	-Wall \
	-I . \
	$(CP_GENERIC_CFLAGS)
video_clear_LDADD = \
	$(CP_GENERIC_LIBS) \
	libCodePorts.la

video_capture_SOURCES = \
	video_capture.c
video_capture_CPPFLAGS = \
	-Wall \
	-I . \
	$(CP_GENERIC_CFLAGS)
video_capture_LDADD = \
	$(CP_GENERIC_LIBS) \
	libCodePorts.la

image_SOURCES = \
	image.c
image_CPPFLAGS = \
	-Wall \
	-I . \
	$(CP_GENERIC_CFLAGS)
image_LDADD = \
	$(CP_GENERIC_LIBS) \
	libCodePorts.la

sprite_SOURCES = \
	sprite.c
sprite_CPPFLAGS = \
	-Wall \
	-I . \
	$(CP_GENERIC_CFLAGS)
sprite_LDADD = \
	$(CP_GENERIC_LIBS) \
	libCodePorts.la
